<h2>{{=T('current language setting')}}:{{=B(session._language)}}</h2>
<h3>{{=T('other language options')}}:</h3>
<div id="nav5">
    <h2 class="nav" id="nav5_label">{{=T('language menu')}}</h2>
        <ul id="navigation1" role="navigation" aria-labelledby="nav5_label" tabindex="-1">
            {{if session._language != 'en':}}
                {{=LI(A('english (en)',_href=URL(r=request,vars=dict(_language='en')),_accesskey="e"))}}
            {{pass}}
            {{if session._language != 'fr-ca':}}
                {{=LI(A('français (fr-ca)',_href=URL(r=request,vars=dict(_language='fr-ca')),_accesskey="q"))}}
            {{pass}}
        </ul>
</div>
<p></p>
<p></p>


{{if session._debug_on == 'True':}}
{{try:}}{{=MENU(response.menu_language,_class='sf-menu')}} {{except:pass}}
<p></p>
<h1>START DEBUGGING FOR views/plugin_language/menu/menu.html</h1>
<h2>To remove debug infromation</h2>
<ul>
    <li>set the session variable session._debug_on to be 'False'
    <ol>
        <li>set the value in this file - could have side affects!</li>      
        <li>pass manuall via url</li>
        <li>install uc_plugin</li>
    </ol>
    </li>
    <li>delete everything in this file from {{session._debug_on = 'True'}} and down ;)</li> 
</ul>
 
<h2>Enable right hand language menu</h2>
<p>see the about file in static.plugin_language/ABOUT</p>

<h2>liscense</h2>
<p>see the about file in static.plugin_language/LISCENSE</p>

<h3>{{=T('language menu examples')}}:{{=B(session._language)}}</h3>
Change languages by selecting one of the following options:
<div id="nav5">
    <h2 class="nav" id="nav5_label">{{=T('language menu')}}</h2>
        <ul id="navigation1" role="navigation" aria-labelledby="nav5_label" tabindex="-1">
            [
            {{if session._language != 'fr-fr':}}
                {{=LI(A('français-français',_href=URL(r=request,vars=dict(_language='fr-fr')),_accesskey="q"))}} (fr-fr) |
            {{pass}}
            {{if session._language != 'fr-qc':}}
                {{=LI(A('français québécois',_href=URL(r=request,vars=dict(_language='fr-qc')),_accesskey="q"))}} (fr-qc) |
            {{pass}}
            {{if session._language != 'fr':}}
                {{=LI(A('français',_href=URL(r=request,vars=dict(_language='fr')),_accesskey="s"))}} (fr)
            {{pass}}            
            ]
        </ul>
</div>          


<h2>Language Variables</h2>
<ul>
     <li><h3>session._language</h3></li>  
        <ul> 
            <li> Language user chooses using this menu to force a language change</li>
            <li> Current Value : {{=session._language}}</li>
            {{if session._language != None:}}
                {{=LI(A('Set session._language to be None',_href=URL(r=request,vars=dict(_language=None)),_accesskey="s"))}} (None)
            {{pass}}    
        </ul>

     <li><h3>request.env.http_accept_language</h3></li>
        <ul>
            <li> Browser language settings and q values</li>
            <li> Current Value : {{=BEAUTIFY(request.env.http_accept_language)}}</li>
        </ul>

    <li><h3>T.requested_languages</h3></li>
        <ul>
            <li> A parsed list of languages accepted by the client</li>
            <li> Current Values : {{=BEAUTIFY(T.requested_languages)}}</li>
        </ul>

     <li><h3>T.current_languages</h3></li>
        <ul>
            <li> a list of languages that should not be translated, set by the developer</li>
            <li> Current Values : {{=BEAUTIFY(T.current_languages)}}</li>
        </ul>

    <li><h3>T.accepted_language</h3></li>
        <ul>
            <li> the language chosen by web2py based on availability</li>
            <li> Current Value : {{=T.accepted_language}}</li>
        </ul>
        
     <li><h3>T.current_languages 0</h3></li>
        <ul>
            <li> The 0 language that should not be translated, set by the developer</li>
            <li> Current Value : {{=T.current_languages[0]}}</li>
        </ul>
</ul>

<h2>Notes</h2>
Notice that for testing we have also added a language (fr-qc) that is not offered by most (all?) browsers at this time yet is still a "legal" representation of a language as far as ISO standards regarding language representations.

<h2>Roadmap</h2>
Application supported languages will eventually be moved into a language db table similar to the following:

<ul>
    <li>table:language</li>
    <li>field:name         # in the targeted language</li>
    <li>field:primary_language_code        # Primary language code, for example 'fr'</li>
    <li>field:secondary_language_code        # Secondary language code, for example 'qc'</li>
    <li>field:is_installed    # bool -'True' or 'False' # See Errors and state info1</li>   
    <li>field:is_enabled      # bool -'True' or 'False'</li>
    
</ul>

and a language managment menu added. This menu would be build using the language management menu and/or automatically in a way that prevents excessive database queries.

<h3>Errors and state information</h3>
    
The language table can be filled and occationaly compared against the Web2py languages directory contents (available language files). If the file is available then the following field would be set to true:

    <li>field:installed # bool -'True' or 'False' # See Errors and state info1</li>
<p>
For languages that are not available (is_installed = 'False' and is_enabled = 'False' ?)
a message to this affect would make troubleshooting easier for languages that may not be supported by the client (browser), for example 'fr-qc'.
</p>

<h3>Application Admin Menu</h3>

An administration menu would appear for users with language administration permissions. This menu would allow the following (in no particular order):
<ul>
<li>addition and removal of languages</li>
<li>duplications and or renaming on language files</li>
</ul>



<h2>End Debug info</h2>
{{pass}}
